Skip to content

[ti_abusech] Add Commercial API support for MalwareBazaar data streams#20199

Open
moxarth-rathod wants to merge 4 commits into
elastic:mainfrom
moxarth-rathod:abusech-malwarebazaar
Open

[ti_abusech] Add Commercial API support for MalwareBazaar data streams#20199
moxarth-rathod wants to merge 4 commits into
elastic:mainfrom
moxarth-rathod:abusech-malwarebazaar

Conversation

@moxarth-rathod

Copy link
Copy Markdown
Contributor

Proposed commit message

ti_abusech: add commercial API support for the MalwareBazaar data stream

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

How to test this PR locally

  • Clone integrations repo.
  • Install elastic package locally.
  • Start elastic stack using elastic-package.
  • Move to integrations/packages/ti_abusech directory.
  • Run the following command to run tests.

elastic-package test

Related issues

@moxarth-rathod moxarth-rathod self-assigned this Jul 18, 2026
@moxarth-rathod
moxarth-rathod requested review from a team as code owners July 18, 2026 06:14
@moxarth-rathod moxarth-rathod added enhancement New feature or request Integration:ti_abusech abuse.ch Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:SDE-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] labels Jul 18, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@github-actions

Copy link
Copy Markdown
Contributor

Elastic Docs Style Checker (Vale)

Summary: 4 suggestions found

💡 Suggestions (4): Optional style improvements. Apply when helpful.
File Line Rule Message
packages/ti_abusech/data_stream/malwarebazaar/fields/fields.yml 211 Elastic.WordChoice Consider using 'run, start' instead of 'execute', unless the term is in the UI.
packages/ti_abusech/data_stream/malwarebazaar/manifest.yml 20 Elastic.WordChoice Consider using 'misuse' instead of 'abuse', unless the term is in the UI.
packages/ti_abusech/data_stream/malwarebazaar/manifest.yml 33 Elastic.WordChoice Consider using 'misuse' instead of 'abuse', unless the term is in the UI.
packages/ti_abusech/data_stream/malwarebazaar/manifest.yml 40 Elastic.WordChoice Consider using 'misuse' instead of 'abuse', unless the term is in the UI.

The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

Package ti_abusech 👍(5) 💚(4) 💔(3)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
ja3_fingerprints 22222.22 9680.54 -12541.68 (-56.44%) 💔
malware 13888.89 6090.13 -7798.76 (-56.15%) 💔
malwarebazaar 9708.74 7530.12 -2178.62 (-22.44%) 💔

To see the full report comment with /test benchmark fullreport

Comment thread packages/ti_abusech/data_stream/malwarebazaar/agent/stream/cel.yml.hbs Outdated
Comment thread packages/ti_abusech/data_stream/malwarebazaar/agent/stream/cel.yml.hbs Outdated
Comment thread packages/ti_abusech/data_stream/malwarebazaar/agent/stream/cel.yml.hbs Outdated
Comment thread packages/ti_abusech/data_stream/malwarebazaar/agent/stream/cel.yml.hbs Outdated
Comment thread packages/ti_abusech/data_stream/malwarebazaar/agent/stream/cel.yml.hbs Outdated
Comment thread packages/ti_abusech/data_stream/malwarebazaar/agent/stream/cel.yml.hbs Outdated
Comment thread packages/ti_abusech/data_stream/malwarebazaar/agent/stream/cel.yml.hbs Outdated
Comment on lines +7 to +8
event.ingested: ".*"
abusech.malwarebazaar.deleted_at: ".*"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need these.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no sample event from the system tests. Can you add this?

{
"code": 200,
"token": "test-commercial-token",
"expires": 4102444800

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

January 1, 2100 for never expires? Has this been tested against a real endpoint so that we know the token requests work?

Alternatively, add a script test for this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this data stream was tested on the live instance.

@andrewkroh andrewkroh added the documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. label Jul 20, 2026
Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
},
"want_more": false,
}
: has(state.?token.access_token) && has(state.?token.expires) && now() < timestamp(int(state.token.expires) - 60) ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: 🟠 High confidence: high path: packages/ti_abusech/data_stream/malwarebazaar/agent/stream/cel.yml.hbs:48

The rendered CEL policy no longer matches the committed test/policy/*.expected files, so elastic-package test policy will fail; regenerate the expected policies from the updated template.

Details

The program: block in cel.yml.hbs contains no Handlebars variables, so the CEL rendered into the policy must be byte-for-byte identical to the program: value stored in _dev/test/policy/test-default.expected and test-all.expected. The template was refactored but the expected policy files were not regenerated, so they now diverge in several places, including:

  • Template has(state.?token.access_token) && has(state.?token.expires) vs expected has(state.token) && has(state.token.access_token) && has(state.token.expires).
  • Template has(state.?cursor.after) / has(state.?cursor.first_seen) vs expected has(state.cursor) && has(state.cursor.after) / has(state.cursor) && has(state.cursor.first_seen).
  • Template has(body.?meta.next_cursor) vs expected has(body.meta) && has(body.meta.next_cursor).
  • Template "id": auth_resp.Status / "id": resp.Status and auth_resp.Status + " (" vs expected "id": string(auth_resp.Status) and string(auth_resp.Status) + " (".
    Because elastic-package test policy compares the rendered template against these committed expected files, the mismatch makes the policy test fail in CI.

Recommendation:

Regenerate the policy test expected files against the current template so the stored program: matches what the template renders:

cd packages/ti_abusech
elastic-package test policy -g

Then re-commit the updated _dev/test/policy/test-default.expected and _dev/test/policy/test-all.expected.


🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

required: true
show_user: true
default: 24h
description: How far back to pull malware samples from MalwareBazaar when using the Commercial API. Supported units for this parameter are d/h/m/s. Example `120h`. Default value is `24h`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: 🟡 Medium confidence: medium path: packages/ti_abusech/data_stream/malwarebazaar/manifest.yml:75

The initial_interval description advertises a d (days) unit, but its value is parsed by CEL duration() which rejects d; drop d from the supported units so users are not led into a runtime error.

Details

initial_interval is consumed by the CEL program as duration(state.initial_interval). mito's duration() uses Go's time.ParseDuration, which only accepts the units ns, us, ms, s, m and h — it does not support d (days). The manifest description states "Supported units for this parameter are d/h/m/s", so a user who follows the documentation and enters a value such as 30d will cause the CEL program to fail at evaluation time with an unknown-unit error. The default (24h) and the example (120h) are valid, but the advertised d unit is not.

Recommendation:

Remove the unsupported d unit from the description so it reflects what duration() actually accepts:

      - name: initial_interval
        type: text
        title: Initial Interval
        multi: false
        required: true
        show_user: true
        default: 24h
        description: How far back to pull malware samples from MalwareBazaar when using the Commercial API. Supported units for this parameter are h/m/s. Example `120h`. Default value is `24h`.

🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@vera-review-bot

Copy link
Copy Markdown

No issues across the latest commits e7adae0.

Review summary

Issues found across earlier commits 62225c5 — 1 high, 1 medium
  • 🟠 The rendered CEL policy no longer matches the committed test/policy/*.expected files, so elastic-package test policy will fail (link) (Unresolved)
  • 🟡 The initial_interval description advertises a d (days) unit, but its value is parsed by CEL duration() which rejects d (link) (Unresolved)

A new commit triggers another review — at most once every 15 minutes. I skip the PR while it's approved or has merge conflicts.

🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @moxarth-rathod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. enhancement New feature or request Integration:ti_abusech abuse.ch Team:SDE-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants